﻿using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Zocono.Infrastructure.Common;
using Zocono.WCS.Domain.PlcReadDbDomain;
using Zocono.WCS.Infrastructure.ApllicationDto;
using Zocono.WCS.Infrastructure.ApllicationDto.DtoWcsManage;

namespace Zocono.WCS.Application.AppConfigureManage
{
    public class PlcReadDbInfoApp
    {
        private readonly IMapper _Mapper;
        private readonly IPlcReadDbInfoService _PlcReadDbInfoservice;


        public PlcReadDbInfoApp(IMapper mapper, IPlcReadDbInfoService PlcReadDbInfoservice)
        {
            _Mapper = mapper;
            _PlcReadDbInfoservice = PlcReadDbInfoservice;
        }

        public async Task<long> AddPlcReadDbInfoAsync(PlcReadDbInfoDto PlcReadDbInfoDto)
        {
            PlcReadDbInfoDto.ObjectIsNullOrEmpty();//数据非空验证
            return await _PlcReadDbInfoservice.AddPlcReadDbInfoAsync(PlcReadDbInfoDto);
        }

        public async Task<bool> DeletePlcReadDbInfoAsync(long ID)
        {
            return await _PlcReadDbInfoservice.DeletePlcReadDbInfoAsync(ID);
        }

        public async Task<bool> UpdatePlcReadDbInfoAsync(PlcReadDbInfoDto PlcReadDbInfoDto)
        {
            PlcReadDbInfoDto.ObjectIsNullOrEmpty();
            return await _PlcReadDbInfoservice.UpdatePlcReadDbInfoAsync(PlcReadDbInfoDto);
        }

        public async Task<PageDto<PlcReadDbInfoDto>> GetPlcReadDbInfoAsync(QueryPlcReadDbInfoDto queryPlcReadDbInfoDto)
        {
            return await _PlcReadDbInfoservice.GetPlcReadDbInfoAsync(queryPlcReadDbInfoDto);
        }

        public async Task<PlcReadDbInfoDto> GetPlcReadDbInfoByIDAsync(long ID)
        {
            return await _PlcReadDbInfoservice.GetPlcReadDbInfoByIDAsync(ID);
        }
    }
}
